package pl.prv.polanie.client.dto;

import com.google.gwt.user.client.rpc.IsSerializable;



/**
 * SubjectEventDTO entity. @author MyEclipse Persistence Tools
 */

public class DeclarationDTO extends java.lang.Object implements IsSerializable {


    // Fields    

     private long id;
     private GroupDTO group;
     private SubgroupTypeDTO subgroupType;
     private SubjectDTO subject;
//     private Long subgroupsAmount;
     private Integer duration;
     

     // Constructors

    /** default constructor */
    public DeclarationDTO() {
    }

     
     
 	/** full constructor */    
    public DeclarationDTO(GroupDTO group, SubgroupTypeDTO subgroupType,
			SubjectDTO subject, Integer duration) {
//    	SubjectDTO subject, Long subgroupsAmount, Integer duration) {
		super();
		this.group = group;
		this.subgroupType = subgroupType;
		this.subject = subject;
//		this.subgroupsAmount = subgroupsAmount;
		this.duration = duration;
	}


	
    // Property accessors
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public SubjectDTO getSubject() {
		return subject;
	}

	public void setSubject(SubjectDTO subject) {
		this.subject = subject;
	}

	public Integer getDuration() {
		return duration;
	}

	public void setDuration(Integer duration) {
		this.duration = duration;
	}



	public GroupDTO getGroup() {
		return group;
	}



	public void setGroup(GroupDTO group) {
		this.group = group;
	}



	public SubgroupTypeDTO getSubgroupType() {
		return subgroupType;
	}



	public void setSubgroupType(SubgroupTypeDTO subgroupType) {
		this.subgroupType = subgroupType;
	}

//	public Long getSubgroupsAmount() {
//		return subgroupsAmount;
//	}
//
//
//
//	public void setSubgroupsAmount(Long subgroupsAmount) {
//		this.subgroupsAmount = subgroupsAmount;
//	}




//    private GroupDTO group;
//    private SubgroupTypeDTO subgroupType;
//    private SubjectDTO subject;
//    private Long capacity;
//    private Integer duration;

	public String toLabel() {
		String r;
		
		
		
		
		String gS;
		if (group != null) {
			gS = group.getName();
		} else {
			gS = "group not assigned";
		};
		
		
		String stS;
		if (subgroupType != null) {
			stS = subgroupType.getName();
		} else {
			stS = "subgroup type not assigned";
		}
		
		String sS;
		if (subject != null) {
			sS = subject.toLabel();
		} else {
			sS = "subject not assigned";
		}
		
//		r = gS + ", " + stS + ", " + sS + " (" + subgroupsAmount + " x " + duration;
		r = gS + ", " + stS + ", " + sS + " (" + duration;
		return r;
	}











}